package main

//Kotlin中并不支持隐式类型转换

val aBoolean: Boolean = true
val anotherBoolean: Boolean = false

//整型32位
val anInt: Int = 8
//十六进制
val anotherInt: Int = 0xFF
//二进制
val moreInt: Int = 0b00000011

val maxInt: Int = Int.MAX_VALUE
val minInt: Int = Int.MIN_VALUE

//长整形64
val maxLong: Long = Long.MAX_VALUE
val minLong: Long = Long.MIN_VALUE

//浮点型32，需要在后面加F
val aFloat: Float = 2.0f
val anotherFloat: Float = 1E3f

val maxFloat: Float = Float.MAX_VALUE
val minFloat: Float = -Float.MAX_VALUE

//双精度浮点型64
val aDouble: Double = 2.0
val anotherDouble: Double = 3.1415926

val maxDouble: Double = Double.MAX_VALUE
val minDouble: Double = -Double.MAX_VALUE

//16
val maxShort: Short = Short.MAX_VALUE
val minShort: Short = Short.MIN_VALUE

//8
val maxByte: Byte = Byte.MAX_VALUE
val minByte: Byte = Byte.MIN_VALUE


//char字符，使用16位的Unicode表示
val aChar: Char = '0'
val anotherChar: Char = '中'
//\u标识Unicode
val moreChar: Char = '\u000f'

fun main() {
    println(anotherInt)
    println(
        moreInt
    )
    val intLong:Long= anInt.toLong();
    println(maxInt)
    println(Math.pow(2.0, 31.0) - 1)
    println(minInt)
    println(-Math.pow(2.0, 31.0))

    //123默认被当作整形，如果想当作长整形后面需要加L
    println(123L)

    println(maxLong)
    println(Math.pow(2.0, 63.0) - 1)
    println(minLong)
    println(-Math.pow(2.0, 63.0))

    println(aFloat)
    println(anotherFloat)


    println(maxFloat)
    println(Float.MIN_VALUE)
    println(minFloat)
    //输出NaN,Not a number
    println(0.0f / 0.0f)

    println(aDouble)
    println(anotherDouble)
    println(maxDouble)
    println(minDouble)
    println(Double.MIN_VALUE)

    println(maxShort)
    println(minShort)

    println(maxByte)
    println(minByte)

    println(aChar)
    println(anotherChar)
    println(moreChar)
}